// 生成器
function* infiniteList () {
  let i = 0
  while (i < 3) {
    yield i++
  }
}
let iterator = infiniteList()
console.log(iterator)
// console.log(iterator.next())
// console.log(iterator.next())
// console.log(iterator.next())
// console.log(iterator.next())